<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>nih: nih::SH_basis&lt; L &gt; Struct Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nih
   &#160;<span id="projectnumber">0.5</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('structnih_1_1_s_h__basis.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">nih::SH_basis&lt; L &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__spherical.html">Spherical and Zonal Harmonics</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="nih::SH_basis" -->
<p><code>#include &lt;<a class="el" href="sh_8h_source.html">sh.h</a>&gt;</code></p>

<p><a href="structnih_1_1_s_h__basis-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename Vector3 &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">static NIH_HOST_DEVICE float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structnih_1_1_s_h__basis.html#a015b1ccbbb8b30cea48b6086e6888958">eval</a> (const int32 i, const Vector3 &amp;d)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static NIH_HOST_DEVICE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structnih_1_1_s_h__basis.html#a2d59e8f416f38c7aff714f45464ceb51">clamped_cosine</a> (const <a class="el" href="structnih_1_1_vector.html">Vector3f</a> &amp;normal, const float w, float *coeffs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static NIH_HOST_DEVICE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structnih_1_1_s_h__basis.html#a26b7088e841914d02b4ad3f8882c0f99">constant</a> (float k, float *coeffs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static NIH_HOST_DEVICE float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structnih_1_1_s_h__basis.html#a38267a663734885b3c85c3db0c20622d">integral</a> (const float *coeffs)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename Vector_type &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">static NIH_HOST_DEVICE float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structnih_1_1_s_h__basis.html#a55821f44183433a4d9571bcfe21464f5">integral</a> (const Vector_type &amp;coeffs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static NIH_HOST_DEVICE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structnih_1_1_s_h__basis.html#ac3977f6d1133e5cbbfc72b5478b9daae">solve</a> (float *coeffs)</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af42f0d137677a2e88dd6d7f4d74d01bc"></a><!-- doxytag: member="nih::SH_basis::ORDER" ref="af42f0d137677a2e88dd6d7f4d74d01bc" args="" -->
static const int32&#160;</td><td class="memItemRight" valign="bottom"><b>ORDER</b> = L</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a36537f2e9987f6c7b68556b6f1c717cc"></a><!-- doxytag: member="nih::SH_basis::COEFFS" ref="a36537f2e9987f6c7b68556b6f1c717cc" args="" -->
static const int32&#160;</td><td class="memItemRight" valign="bottom"><b>COEFFS</b> = L*L</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;int32 L&gt;<br/>
struct nih::SH_basis&lt; L &gt;</h3>

<p>Spherical harmonics basis functions of order L </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2d59e8f416f38c7aff714f45464ceb51"></a><!-- doxytag: member="nih::SH_basis::clamped_cosine" ref="a2d59e8f416f38c7aff714f45464ceb51" args="(const Vector3f &amp;normal, const float w, float *coeffs)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int32 L&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">NIH_HOST_DEVICE void <a class="el" href="structnih_1_1_s_h__basis.html">nih::SH_basis</a>&lt; L &gt;::clamped_cosine </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structnih_1_1_vector.html">Vector3f</a> &amp;&#160;</td>
          <td class="paramname"><em>normal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>coeffs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>add a weighted basis expansion of a clamped cosine lobe to a given set of coefficients</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">normal</td><td>input normal </td></tr>
    <tr><td class="paramname">w</td><td>scalar weight </td></tr>
    <tr><td class="paramname">coeffs</td><td>input/output coefficients </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a26b7088e841914d02b4ad3f8882c0f99"></a><!-- doxytag: member="nih::SH_basis::constant" ref="a26b7088e841914d02b4ad3f8882c0f99" args="(float k, float *coeffs)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int32 L&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">NIH_HOST_DEVICE void <a class="el" href="structnih_1_1_s_h__basis.html">nih::SH_basis</a>&lt; L &gt;::constant </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>coeffs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return the basis expansion of a constant</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">k</td><td>input constant </td></tr>
    <tr><td class="paramname">coeffs</td><td>output coefficients </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a015b1ccbbb8b30cea48b6086e6888958"></a><!-- doxytag: member="nih::SH_basis::eval" ref="a015b1ccbbb8b30cea48b6086e6888958" args="(const int32 i, const Vector3 &amp;d)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int32 L&gt; </div>
<div class="memtemplate">
template&lt;typename Vector3 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">NIH_HOST_DEVICE float <a class="el" href="structnih_1_1_s_h__basis.html">nih::SH_basis</a>&lt; L &gt;::eval </td>
          <td>(</td>
          <td class="paramtype">const int32&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vector3 &amp;&#160;</td>
          <td class="paramname"><em>d</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>evaluate the i-th coefficient at a given point</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>coefficient index </td></tr>
    <tr><td class="paramname">d</td><td>direction vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a38267a663734885b3c85c3db0c20622d"></a><!-- doxytag: member="nih::SH_basis::integral" ref="a38267a663734885b3c85c3db0c20622d" args="(const float *coeffs)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int32 L&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static NIH_HOST_DEVICE float <a class="el" href="structnih_1_1_s_h__basis.html">nih::SH_basis</a>&lt; L &gt;::integral </td>
          <td>(</td>
          <td class="paramtype">const float *&#160;</td>
          <td class="paramname"><em>coeffs</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return the integral of a spherical hamonics function </p>

</div>
</div>
<a class="anchor" id="a55821f44183433a4d9571bcfe21464f5"></a><!-- doxytag: member="nih::SH_basis::integral" ref="a55821f44183433a4d9571bcfe21464f5" args="(const Vector_type &amp;coeffs)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int32 L&gt; </div>
<div class="memtemplate">
template&lt;typename Vector_type &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static NIH_HOST_DEVICE float <a class="el" href="structnih_1_1_s_h__basis.html">nih::SH_basis</a>&lt; L &gt;::integral </td>
          <td>(</td>
          <td class="paramtype">const Vector_type &amp;&#160;</td>
          <td class="paramname"><em>coeffs</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return the integral of a spherical hamonics function </p>

</div>
</div>
<a class="anchor" id="ac3977f6d1133e5cbbfc72b5478b9daae"></a><!-- doxytag: member="nih::SH_basis::solve" ref="ac3977f6d1133e5cbbfc72b5478b9daae" args="(float *coeffs)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int32 L&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static NIH_HOST_DEVICE void <a class="el" href="structnih_1_1_s_h__basis.html">nih::SH_basis</a>&lt; L &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>coeffs</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>solve the linear least squares projection for a set of coefficients</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">coeffs</td><td>input projection coefficients </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>spherical/<a class="el" href="sh_8h_source.html">sh.h</a></li>
<li>spherical/<a class="el" href="sh__inline_8h_source.html">sh_inline.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>nih</b>      </li>
      <li class="navelem"><a class="el" href="structnih_1_1_s_h__basis.html">SH_basis</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Thu Dec 15 2011 11:56:22 for nih by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
